﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MakeRoom.aspx.cs" Inherits="_2011DBProject.MakeRoom" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel=StyleSheet HREF='design1.css' type='text/css'>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p align = "left">
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" />
        <asp:Button ID="btnGoCharacter" runat="server" onclick="btnGoCharacter_onclick" 
            Text="☜ 캐 릭 선 택" Width="150px" />
        <asp:Button ID="btnGoChannel" runat="server" onclick="btnGoChannel_onclick" 
            Text="☜ 채 널 선 택" Width="150px" />
        <asp:Button ID="btnGoGameroom" runat="server" onclick="btnGoGameroom_onclick" 
            Text="☜ 메 인 화 면" Width="150px" />
        </p>

    
        <br />
        현재 채널에 개설되어있는 방 목록<br />

    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="CHANNEL_NO,SERVER_NO,GAMEROOM_NO" 
            DataSourceID="sqldsGameroom" 
            EmptyDataText="There are no data records to display." ForeColor="#333333" 
            GridLines="None" HorizontalAlign="Center">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:BoundField DataField="GAMEROOM_NO" HeaderText="순번" 
                    ReadOnly="True" SortExpression="GAMEROOM_NO" />
                <asp:BoundField DataField="GAMEROOM_NAME" HeaderText="방 이 름" 
                    SortExpression="GAMEROOM_NAME" >
                <HeaderStyle Width="200px" />
                </asp:BoundField>
                <asp:BoundField DataField="GAME_TYPE" HeaderText="경기규칙" 
                    SortExpression="GAME_TYPE" />
                <asp:BoundField DataField="PARTICIPANT_QTY" HeaderText="최대인원" 
                    SortExpression="PARTICIPANT_QTY" />
                <asp:BoundField DataField="HOLE_QTY" HeaderText="홀수" 
                    SortExpression="HOLE_QTY" />
                <asp:BoundField DataField="MIN_LEVEL" HeaderText="요구레벨" 
                    SortExpression="MIN_LEVEL" />
                <asp:BoundField DataField="PASSWORD" HeaderText="PASSWORD" 
                    SortExpression="PASSWORD" Visible="False" />
                <asp:BoundField DataField="COURSE_NO" HeaderText="코스번호" 
                    SortExpression="COURSE_NO" />
                <asp:BoundField DataField="SERVER_NO" HeaderText="SERVER_NO" ReadOnly="True" 
                    SortExpression="SERVER_NO" Visible="False" />
                <asp:BoundField DataField="CHANNEL_NO" HeaderText="CHANNEL_NO" ReadOnly="True" 
                    SortExpression="CHANNEL_NO" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
            <PagerStyle ForeColor="White" HorizontalAlign="Center" BackColor="#2461BF" />
            <EmptyDataTemplate>
                <br />
                <font size="3px" color="#ffff99">개설된 방이 없습니다.</font><br />
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsGameroom" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM &quot;GAMEROOM&quot; WHERE &quot;CHANNEL_NO&quot; = :original_CHANNEL_NO AND &quot;SERVER_NO&quot; = :original_SERVER_NO AND &quot;GAMEROOM_NO&quot; = :original_GAMEROOM_NO AND ((&quot;GAME_TYPE&quot; = :original_GAME_TYPE) OR (&quot;GAME_TYPE&quot; IS NULL AND :original_GAME_TYPE IS NULL)) AND ((&quot;PARTICIPANT_QTY&quot; = :original_PARTICIPANT_QTY) OR (&quot;PARTICIPANT_QTY&quot; IS NULL AND :original_PARTICIPANT_QTY IS NULL)) AND ((&quot;HOLE_QTY&quot; = :original_HOLE_QTY) OR (&quot;HOLE_QTY&quot; IS NULL AND :original_HOLE_QTY IS NULL)) AND ((&quot;MIN_LEVEL&quot; = :original_MIN_LEVEL) OR (&quot;MIN_LEVEL&quot; IS NULL AND :original_MIN_LEVEL IS NULL)) AND ((&quot;PASSWORD&quot; = :original_PASSWORD) OR (&quot;PASSWORD&quot; IS NULL AND :original_PASSWORD IS NULL)) AND &quot;COURSE_NO&quot; = :original_COURSE_NO AND ((&quot;GAMEROOM_NAME&quot; = :original_GAMEROOM_NAME) OR (&quot;GAMEROOM_NAME&quot; IS NULL AND :original_GAMEROOM_NAME IS NULL))" 
            InsertCommand="INSERT INTO &quot;GAMEROOM&quot; (&quot;CHANNEL_NO&quot;, &quot;GAME_TYPE&quot;, &quot;PARTICIPANT_QTY&quot;, &quot;HOLE_QTY&quot;, &quot;MIN_LEVEL&quot;, &quot;PASSWORD&quot;, &quot;SERVER_NO&quot;, &quot;COURSE_NO&quot;, &quot;GAMEROOM_NO&quot;, &quot;GAMEROOM_NAME&quot;) VALUES (:CHANNEL_NO, :GAME_TYPE, :PARTICIPANT_QTY, :HOLE_QTY, :MIN_LEVEL, :PASSWORD, :SERVER_NO, :COURSE_NO, :GAMEROOM_NO, :GAMEROOM_NAME)" 
            OldValuesParameterFormatString="original_{0}" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT &quot;CHANNEL_NO&quot;, &quot;GAME_TYPE&quot;, &quot;PARTICIPANT_QTY&quot;, &quot;HOLE_QTY&quot;, &quot;MIN_LEVEL&quot;, &quot;PASSWORD&quot;, &quot;SERVER_NO&quot;, &quot;COURSE_NO&quot;, &quot;GAMEROOM_NO&quot;, &quot;GAMEROOM_NAME&quot; FROM &quot;GAMEROOM&quot; WHERE ((&quot;CHANNEL_NO&quot; = :CHANNEL_NO) AND (&quot;SERVER_NO&quot; = :SERVER_NO)) and GAMEROOM_NO != 0" 
            
            UpdateCommand="UPDATE &quot;GAMEROOM&quot; SET &quot;GAME_TYPE&quot; = :GAME_TYPE, &quot;PARTICIPANT_QTY&quot; = :PARTICIPANT_QTY, &quot;HOLE_QTY&quot; = :HOLE_QTY, &quot;MIN_LEVEL&quot; = :MIN_LEVEL, &quot;PASSWORD&quot; = :PASSWORD, &quot;COURSE_NO&quot; = :COURSE_NO, &quot;GAMEROOM_NAME&quot; = :GAMEROOM_NAME WHERE &quot;CHANNEL_NO&quot; = :original_CHANNEL_NO AND &quot;SERVER_NO&quot; = :original_SERVER_NO AND &quot;GAMEROOM_NO&quot; = :original_GAMEROOM_NO AND ((&quot;GAME_TYPE&quot; = :original_GAME_TYPE) OR (&quot;GAME_TYPE&quot; IS NULL AND :original_GAME_TYPE IS NULL)) AND ((&quot;PARTICIPANT_QTY&quot; = :original_PARTICIPANT_QTY) OR (&quot;PARTICIPANT_QTY&quot; IS NULL AND :original_PARTICIPANT_QTY IS NULL)) AND ((&quot;HOLE_QTY&quot; = :original_HOLE_QTY) OR (&quot;HOLE_QTY&quot; IS NULL AND :original_HOLE_QTY IS NULL)) AND ((&quot;MIN_LEVEL&quot; = :original_MIN_LEVEL) OR (&quot;MIN_LEVEL&quot; IS NULL AND :original_MIN_LEVEL IS NULL)) AND ((&quot;PASSWORD&quot; = :original_PASSWORD) OR (&quot;PASSWORD&quot; IS NULL AND :original_PASSWORD IS NULL)) AND &quot;COURSE_NO&quot; = :original_COURSE_NO AND ((&quot;GAMEROOM_NAME&quot; = :original_GAMEROOM_NAME) OR (&quot;GAMEROOM_NAME&quot; IS NULL AND :original_GAMEROOM_NAME IS NULL))">
            <SelectParameters>
                <asp:SessionParameter Name="CHANNEL_NO" SessionField="Ch" Type="Decimal" />
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="CHANNEL_NO" Type="Decimal" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="GAMEROOM_NO" Type="Decimal" />
                <asp:Parameter Name="original_GAME_TYPE" />
                <asp:Parameter Name="original_PARTICIPANT_QTY" />
                <asp:Parameter Name="original_HOLE_QTY" />
                <asp:Parameter Name="original_MIN_LEVEL" />
                <asp:Parameter Name="original_PASSWORD" />
                <asp:Parameter Name="original_COURSE_NO" />
                <asp:Parameter Name="original_GAMEROOM_NAME" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="CHANNEL_NO" Type="Decimal" />
                <asp:Parameter Name="GAME_TYPE" Type="String" />
                <asp:Parameter Name="PARTICIPANT_QTY" Type="Decimal" />
                <asp:Parameter Name="HOLE_QTY" Type="Decimal" />
                <asp:Parameter Name="MIN_LEVEL" Type="Decimal" />
                <asp:Parameter Name="PASSWORD" Type="String" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="COURSE_NO" Type="Decimal" />
                <asp:Parameter Name="GAMEROOM_NO" Type="Decimal" />
                <asp:Parameter Name="GAMEROOM_NAME" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="GAME_TYPE" Type="String" />
                <asp:Parameter Name="PARTICIPANT_QTY" Type="Decimal" />
                <asp:Parameter Name="HOLE_QTY" Type="Decimal" />
                <asp:Parameter Name="MIN_LEVEL" Type="Decimal" />
                <asp:Parameter Name="PASSWORD" Type="String" />
                <asp:Parameter Name="COURSE_NO" Type="Decimal" />
                <asp:Parameter Name="GAMEROOM_NAME" Type="String" />
                <asp:Parameter Name="original_CHANNEL_NO" Type="Decimal" />
                <asp:Parameter Name="original_SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="original_GAMEROOM_NO" Type="Decimal" />
                <asp:Parameter Name="original_GAME_TYPE" Type="String" />
                <asp:Parameter Name="original_PARTICIPANT_QTY" Type="Decimal" />
                <asp:Parameter Name="original_HOLE_QTY" Type="Decimal" />
                <asp:Parameter Name="original_MIN_LEVEL" Type="Decimal" />
                <asp:Parameter Name="original_PASSWORD" Type="String" />
                <asp:Parameter Name="original_COURSE_NO" Type="Decimal" />
                <asp:Parameter Name="original_GAMEROOM_NAME" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
        <br />
        <br />
    
        <br />
        <br />
        <br />
        
        <table class = "normalTable" align="center">
            <tr>
                <td>방 이 름</td>
                <td>
                    <asp:TextBox ID="txtRoomName" runat="server" Width="150px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>비 밀 방</td>
                <td>
                    <asp:CheckBox ID="CheckBox1" runat="server" Height="23" AutoPostBack="true" OnCheckedChanged="chkPassword_onclick"/>
                    <asp:TextBox ID="txtPass" runat="server" Width="120px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>코 스</td>
                <td>
                    <asp:DropDownList ID="DropDownCource" runat="server" Height="16px" 
                        Width="150px" DataSourceID="SqlDataSource1" DataTextField="COURSE_NAME" 
                        DataValueField="COURSE_NO">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                        SelectCommand="SELECT &quot;COURSE_NAME&quot;, &quot;COURSE_NO&quot; FROM &quot;COURSE&quot;">
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td>경기방식</td>
                <td>
                    <asp:DropDownList ID="DropDownRule" runat="server" Height="16px" Width="150px">
                        <asp:ListItem>스크로크</asp:ListItem>
                        <asp:ListItem>매치</asp:ListItem>
                        <asp:ListItem>스크라치</asp:ListItem>
                        <asp:ListItem>스킨스</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>참여인원</td>
                <td>
                    <asp:DropDownList ID="DropDownPeople" runat="server" Height="16px" Width="150px">
                        <asp:ListItem Value="2">2명</asp:ListItem>
                        <asp:ListItem Value="3">3명</asp:ListItem>
                        <asp:ListItem Value="4">4명</asp:ListItem>
                        <asp:ListItem Value="5">5명</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>라운딩홀수</td>
                <td>
                    <asp:DropDownList ID="DropDownHoles" runat="server" Height="16px" Width="150px">
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>9</asp:ListItem>
                        <asp:ListItem>18</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>레벨제한</td>
                <td>
                    <asp:DropDownList ID="DropDownMinLv" runat="server" Height="16px" Width="150px">
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>20</asp:ListItem>
                        <asp:ListItem>30</asp:ListItem>
                        <asp:ListItem>40</asp:ListItem>
                        <asp:ListItem>50</asp:ListItem>
                        <asp:ListItem>60</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
            <td colspan=2>
                <asp:Button ID="btnMakeRoom" runat="server" Text="게임방 생성" Width="255px" 
                    onclick="btnMakeRoom_Click" Height="37px" />
            </td>
            </tr>
        </table>
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
